package com.zhipu.balance.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.zhipu.balance.ui.start.StartActivity

class BootBroadcastReceiver : BroadcastReceiver(){
    val ACTION = "android.intent.action.BOOT_COMPLETED"

    override fun onReceive(context: Context?, intent: Intent?) {

        if (intent!!.action == ACTION) {
            val mainActivityIntent = Intent(context, StartActivity::class.java) // 要启动的Activity
            mainActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            context!!.startActivity(mainActivityIntent)
        }
    }
}